package com.dhcc.bpm.modules.scf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.scf.dto.ScfRenewableOutInfoDTO;
import com.dhcc.bpm.modules.scf.entity.ScfRenewableOutInfo;
import com.dhcc.bpm.modules.scf.entity.SelectEntity.RenewableOutByRenewableIn;
import com.dhcc.bpm.modules.scf.vo.ScfRenewableInInfoVO.ScfGetRenewableInDetailsVO;
import com.dhcc.bpm.modules.scf.vo.ScfRenewableOutInfoVO.ScfGetRenewableOutDetailsVO;
import com.dhcc.bpm.modules.scf.vo.ScfRenewableOutInfoVO.ScfGetRenewableOutListVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *  再生资源出库-Mapper接口
 *
 * @author liuguoting
 * @since 2023-09-22
 */
@Repository
public interface ScfRenewableOutInfoMapper extends BaseMapper<ScfRenewableOutInfo> {
    /**
     * 自定义分页
     *
     * @param page
     * @param scfRenewableOutInfo
     * @return
     */
    List<ScfGetRenewableOutListVO> selectScfRenewableOutInfoPage(IPage<ScfGetRenewableOutListVO> page, ScfRenewableOutInfoDTO scfRenewableOutInfo);

    /**
     * 自定义分页查询--查询未被关联记录
     *
     * @return
     */
    List<ScfGetRenewableOutListVO> selectUnrelatedRenewableOutRecords(IPage<ScfGetRenewableOutListVO> page, ScfRenewableOutInfoDTO scfRenewableOutInfo);

    /**
     * 自定义查询详情
     *
     * @param scfRenewableOutInfo
     * @return
     */
    ScfGetRenewableOutDetailsVO getDetails(String rowId);

    /**
     * 根据再生出库单获取再生出库单编号rowId
     *
     * @param renewableOutNum
     * @return
     */
    String selectRowIdByRenewableOutNum(String renewableOutNum);

    /**
     * 再生出库关联再生入库关系保存
     *
     * @param renewableOutByRenewableIn
     * @return
     */

    int saveRenewableOutByRenewableInt(RenewableOutByRenewableIn renewableOutByRenewableIn);

    /**
     * 根据再生出库单删除再生出库单与再生入库单对应的关联关系表中的记录
     *
     * @param renewableOutNum
     * @return
     */
    int deleteRenewableOutByRenewableInt(String renewableOutNum);

    /**
     * 根据再生资源出库单查询与之对应的再生资源入库单关联关系
     *
     * 再生出库 和再生入库的关联关系。。。。。
     *
     * @param renewableOutNum
     * @return
     */
    List<ScfGetRenewableInDetailsVO> selectRenewableOutByRenewableInt(String renewableOutNum);


    boolean deleteByIds(String[] ids);
}
